<?php

use Illuminate\Http\Request;
use Illuminate\Support\Facades\Route;

/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/
Route::get('/test/{id}', 'TestController@index');//列表
Route::post('/login', 'AuthController@login')->name('api.auth.login');//登录
Route::post('/register', 'AuthController@register')->name('api.auth.register');//注册
//Route::get('/share/{img}', 'UsersController@shareImg');

//Route::get('/share/G1V3X6VRSs.txt', 'UsersController@share');
Route::group(['middleware' => 'auth.jwt'], function () {
    // 获取分享图片
    Route::post('share/img', 'UsersController@shareImg');

    Route::get('main', 'IndexController@index')->name('api.index.index');
    // 上传图片
    Route::post('upload', 'IndexController@upload')->name('api.index.upload');
    // 医检反馈
    Route::post('feedback', 'FeedbackController@create')->name('api.feedback.create');
    //用户
    Route::group(['prefix' => 'member'], function () {
        Route::get('/', 'MemberController@index')->name('api.member.index');//列表
        Route::get('/info', 'MemberController@info')->name('api.member.info');//详情
        Route::post('/update', 'MemberController@update')->name('api.member.update');//更新
//        Route::get('/qr_code', 'MemberController@qrCode')->name('api.member.qrCode');
    });

    //分组管理
    Route::group(['prefix' => 'group'], function () {
        Route::get('/', 'GroupController@index')->name('api.group.index');//列表
        Route::post('/update', 'GroupController@update')->name('api.group.update');//更新
        Route::post('/destroy', 'GroupController@destroy')->name('api.group.destroy');//删除
    });

    // users
    Route::post('/user/info', 'UsersController@info');//获取基本信息
    Route::post('/user/update', 'UsersController@update');//更新基本信息

    // ocr
    Route::post('/ocr-upload', 'OcrController@upload');//上传分析图片进行分析
    Route::post('/ocr/info', 'OcrController@info');//获取分析数据
    Route::post('/ocr/edit-basic', 'OcrController@editBasic');//编辑基础数据
    Route::post('/ocr/edit-ext', 'OcrController@editExt');//编辑扩展数据
    Route::post('/ocr/del', 'OcrController@del');//删除ocr
    Route::post('/ocr/lists', 'OcrController@lists');//列表ocr

    //问诊 consultations
    Route::group(['prefix' => 'consultation'], function () {
        Route::get('/list', 'ConsultationController@index')->name('api.consultation.index');//获取问诊记录列表
        Route::get('/detail', 'ConsultationController@detail')->name('api.consultation.detail');//获取问诊详情
        Route::post('/create', 'ConsultationController@create')->name('api.consultation.create');//创建问诊
        Route::post('/upload', 'ConsultationController@upload')->name('api.consultation.upload');//问诊图片
        Route::post('/record', 'ConsultationController@record')->name('api.consultation.record');//获取对话记录列表
        Route::post('/record_ask', 'ConsultationController@recordAsk')->name('api.consultation.recordAsk');//提问
    });
});
